

function register(){


	let username = document.querySelector('#username').value
	let password = document.querySelector('#password').value
	let email = document.querySelector('#email').value
	let sex 
	
	
	
	
	let sexList = document.getElementsByName("sex")
	
	for (var i = 0; i < sexList.length; i++) {
		if(sexList[i].checked){
			sex = sexList[i].value
		}
	}
	
	
	let user = {
		userEmail:email,
		userName:username,
		userPassword:password,
		userSex:sex
	}
	
	ajax("post","/user/register",user,function(data){
		console.log(data);
		if(data.code == 200){
			alert("注册成功")
			window.location.href = window.webUrl + "/index.html"
		}else{
			alert(data.msg)
		}
	},
	function(){
		
	})

}